# $Id: PKGBUILD 89205 2013-04-28 02:49:36Z kkeen $
# Maintainer:

pkgbase=isodate
pkgname=('python2-isodate' 'python-isodate')
pkgver=0.4.9
pkgrel=1
pkgdesc="An ISO 8601 date/time/duration parser and formater"
arch=('any')
url="http://pypi.python.org/pypi/isodate"
license=('BSD')
makedepends=('python2' 'python')
checkdepends=('python2-distribute' 'python-distribute')
source=(http://pypi.python.org/packages/source/i/isodate/$pkgbase-$pkgver.tar.gz)
sha1sums=('fa79e46780ef3585bb052fe6c71e27c1146ceacd')

check() {
  cd "$srcdir/$pkgbase-$pkgver"
  python2 setup.py test
  python setup.py test
}

package_python2-isodate() {
  depends=('python2')

  cd "$srcdir/$pkgbase-$pkgver"
  python2 setup.py install --root="$pkgdir/" --optimize=1
  install -d "${pkgdir}/usr/share/licenses/${pkgname}"
  head -26 src/isodate/isodates.py > "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_python-isodate() {
  depends=('python')

  cd "$srcdir/$pkgbase-$pkgver"
  python setup.py install --root="$pkgdir/" --optimize=1
  install -d "${pkgdir}/usr/share/licenses/${pkgname}"
  head -26 src/isodate/isodates.py > "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
